import { increment, decrement } from "../actions/count.action"
import { handleActions as createReducer } from 'redux-actions';

const initialState = {count:1}

const handleIncrement = (state, action) => {
    return {
        ...state,
        count:state.count + action.payload
    }
}
const handleDecrement = (state, action) => {
    return {
        ...state,
        count:state.count - action.payload
    }
}
export default createReducer({
    [increment]:handleIncrement,
    [decrement]:handleDecrement,
}, initialState)

